<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta
			name="viewport"
			content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"
		/>
		<meta name="format-detection" content="telephone=no" />
		<meta name="format-detection" content="email=no" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<title>门诊列表</title>
		<!-- 引入 vant UI 组件库样式文件 -->
		<link rel="stylesheet" href="../common/css/vant-index.css" />
		<link rel="stylesheet" href="../common/css/common.css" />
		<link rel="stylesheet" href="css/doctor.css" />
	</head>

	<body>
		<div id='app' v-cloak>
			<div class="id_container">
				<p class='opc_titledate'>{{dateTitle}}</p>
				<van-list class='list_box_100 doctor_box' v-if="nothing==1" v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
					<div class="mpl_item" v-for="item in detail" @click="linkToDetail(item.flupId,item.patientId)">
						<div class="mpl_item_left">
							<img v-if="item.avatar" :src="item.avatar" />
							<img v-if="!item.avatar" src="img/logo.png" />
						</div>
						<div class="mpl_item_right opc_center">
							<div class="opc_center_top">
								<span class='fontsize16' v-if="item.name.length>6">{{item.name.substring(0,6)}}...</span>
								<span class='fontsize16' v-if="item.name.length<=6">{{item.name}}</span>
								<span style="margin: 0 5px;">{{item.age}}</span>
								<span>
									<img v-if="item.sex==1" src="img/man.png" />
									<img v-if="item.sex==2" src="img/woman.png" />
								</span>
							</div>
							<div class="">
								<span>糖尿病类型：</span>
								<span class='colora1'>{{item.diabetesType}}</span>
							</div>
							<div class="" v-if='item.diabetesType!="未确诊"'>
								<span>确诊日期：</span>
								<span class='colora1'>{{item.diabetesDate}}</span>
							</div>
							<div class="" v-else>
								<span>检测日期：</span>
								<span class='colora1'>{{item.flupDate}}</span>
							</div>
							<div class="">
								<span>简要病史：</span>
								<span class='colora1'>{{item.patientDesc}}</span>
							</div>
						</div>
						<div class="opc_right">
							<div class="">
								<img src="img/manage/stLine-time-l.png" alt="" />
							</div>
							
							<p>{{item.startTime}}-{{item.endTime}}</p>
						</div>
					</div>
				</van-list>
				<van-empty v-if="nothing==2" class="custom-image" image="img/blank_pic.png" description="暂无患者" />

				

			</div>

			<link-index></link-index>
		</div>
	</body>
	<!-- 引入 rem -->
	<script src="../common/js/rem.js"></script>
	<!-- 上线环境用 -->
	<script src="../common/js/vue.global.prod.js"></script>
	<!-- 引入 UI 组件库 -->
	<script src="../common/js/vant.min.js"></script>
	<!-- axios 接口调用 -->
	<script src="../common/js/axios.min.js"></script>
	<script src="../base.js"></script>
	<script src="../common/js/url.min.js"></script>
	
	<script type="module">
		import {
			getAction,
			postAction,
			spliceUrl,
		} from "../common/js/api/vue3-axios-utils.js";

		import { linkIndex } from "../common/js/template/linkIndex.js"

		const PatientData = {
			data() {
				return {
					url: {
						getDetail:'/flup/date/get',
					},
					doctorId:'',
					detail:[],
					nothing:1,
					date:'',
					dateTitle:''
				};
			},
			created() {
				this.doctorId = url('?id')
				this.date = url('?date')
				console.log('from',this.from)
				this.init()
			},
			methods: {
				async init () {
					await this.handleDetail()
	           	},
				handleDetail(){
					getAction(spliceUrl(this.url.getDetail),{doctorId:this.doctorId,date:this.date}).then((res) => {
						res = res.data
						console.log('handleGetDetail',res)
						if(res.success){
							if(res.result.count){
								this.nothing = 1
								this.dateTitle = res.result.queryDate
								this.detail = res.result.patientFlupInfoList
							}else{
								this.nothing = 2
								this.detail = []
							}
						}
					})
				},
				linkToDetail(fid,pid){
					window.location.href = '../patient/follow/notVisitRecord.html?from=doctor&id='+this.doctorId+'&flupid='+fid+'&patientid='+pid
				}
			},
			components:{
				linkIndex:linkIndex
			}
		};

		const app = Vue.createApp(PatientData);

		app.use(vant);

		// 通过 CDN 引入时不会自动注册 Lazyload 组件
		// 可以通过下面的方式手动注册
		app.use(vant.Lazyload);

		// 调用函数组件，弹出一个 Toast
		// vant.Toast("刷新成功");

		app.mount("#app");
	</script>

</html>

